package top.yihoxu.yoj.judge.codesandbox;

import top.yihoxu.yoj.judge.codesandbox.CodeSandbox;
import top.yihoxu.yoj.judge.codesandbox.impl.ExampleCodeSandBox;
import top.yihoxu.yoj.judge.codesandbox.impl.RemoteCodeSandBox;
import top.yihoxu.yoj.judge.codesandbox.impl.ThirdPartyCodeSandBox;

/**
 * @Author dth
 * @Date 2024/5/3 21:20
 * @PackageName:top.yihoxu.yoj.judge
 * @ClassName: CodeSandBoxFactory
 * @Description: 代码沙箱工厂
 * @Version 1.0
 */
public class CodeSandBoxFactory {

    public static CodeSandbox newInstance(String type) {
        switch (type) {
            case "example":
                return new ExampleCodeSandBox();
            case "remote":
                return new RemoteCodeSandBox();
            case "thirdParty":
                return new ThirdPartyCodeSandBox();
            default:
                return new ExampleCodeSandBox();
        }
    }
}
